/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package classes;

import java.sql.Timestamp;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author Shelling Ford
 */
public class Message {
    // attribut

    public int id = 0;
    public User sender;
    public Room recepientRoom;
    public User recepientUser;
    public String content;
    public Timestamp timestamp;

    public Message(User sender, Room recepientRoom, String content) {
        Calendar calendar = Calendar.getInstance();
        Date now = calendar.getTime();

        this.sender = sender;
        this.recepientRoom = recepientRoom;
        this.content = content;
        this.timestamp = new java.sql.Timestamp(now.getTime());
    }

    public Message(User sender, User recepientUser, String content) {
        Calendar calendar = Calendar.getInstance();
        Date now = calendar.getTime();

        this.sender = sender;
        this.recepientUser = recepientUser;
        this.content = content;
        this.timestamp = new java.sql.Timestamp(now.getTime());
    }

    // bikin user yang usernamenya "[ChatOK System]"
}
